﻿using System;
using System.Windows.Data;
using System.Windows;
using Minesweeper.Windows.Controls;

namespace Minesweeper.Converter
{
    public class MultiMarginConverter : IMultiValueConverter
    {

        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            FieldButton button = parameter as FieldButton;
            double x = System.Convert.ToDouble(values[0]);
            double y = System.Convert.ToDouble(values[1]);
            return new Thickness(x * button.X,
                                 y * button.Y,
                                 0,
                                 0);
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
        {
            return null;
        }
    }
}
